package com.godyao.mall.goods;

import com.godyao.mall.core.audit.MyAuditorAwaree;
import com.godyao.mall.core.model.goods.Goods;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.AuditorAware;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * @author godyao
 * @date 2022/3/31
 */
@EntityScan(basePackages = {"com.godyao.mall.core.model", "com.godyao.mall.goods.es.model"})
@EnableElasticsearchRepositories(basePackages = "com.godyao.mall.goods.es.repository")
@EnableJpaRepositories(basePackages = "com.godyao.mall.goods.repository")
@EnableJpaAuditing
@SpringBootApplication
public class MallGoodsApplication {
    public static void main(String[] args) {
        SpringApplication.run(MallGoodsApplication.class, args);
    }
    @Bean
    public AuditorAware<String> auditorAware() {
        return new MyAuditorAwaree();
    }
}
